﻿namespace Devonline.Entity;

/// <summary>
/// 限制名单, 字符串主键的默认实现
/// 限制名单: 限制名单中的用户/单位等访问某种业务
/// 白 名 单: 限制别人访问白名单中的内容, 比如禁止查询白名单中的内容等  
/// </summary>
[Cacheable]
[Table("limit_list"), DisplayName("限制名单")]
public class LimitList : LimitList<string>, ITimeRange, IBusiness, IEntitySet, IEntitySetWithCreate, IEntitySetWithCreateAndUpdate { }

/// <summary>
/// 限制名单
/// 限制名单: 限制名单中的用户/单位等访问某种业务
/// 白 名 单: 限制别人访问白名单中的内容, 比如禁止查询白名单中的内容等  
/// </summary>
[Table("limit_list"), DisplayName("限制名单")]
public abstract class LimitList<TKey> : EntitySetWithCreateAndUpdate<TKey>, ITimeRange<TKey>, IBusiness<TKey>, IEntitySet<TKey>, IEntitySetWithCreate<TKey>, IEntitySetWithCreateAndUpdate<TKey> where TKey : IConvertible
{
    /// <summary>
    /// 业务类型
    /// </summary> 
    [Column("business_type"), DisplayName("业务类型"), MaxLength(128), Excel]
    public virtual string? BusinessType { get; set; }
    /// <summary>
    /// 业务主键
    /// </summary>
    [Column("business_key"), DisplayName("业务主键"), MaxLength(36), Excel]
    public virtual TKey? BusinessKey { get; set; }
    /// <summary>
    /// 名称
    /// </summary>
    [Column("name"), DisplayName("名称"), Required, MaxLength(128), Excel]
    public virtual string? Name { get; set; }
    /// <summary>
    /// 内容
    /// </summary>
    [Column("content"), DisplayName("内容"), Required, MaxLength(256), Excel]
    public virtual string? Content { get; set; }
    /// <summary>
    /// 限制日期
    /// </summary>
    [Column("start_time"), DisplayName("限制日期"), Excel]
    public virtual DateTime StartTime { get; set; }
    /// <summary>
    /// 解除日期
    /// </summary>
    [Column("end_time"), DisplayName("解除日期"), Excel]
    public virtual DateTime? EndTime { get; set; }
}